#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QtCharts>
QT_CHARTS_USE_NAMESPACE

#define MAX_X   50
#define MAX_Y   70
#define TRUE    1
#define FALSE   0

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    int isDraw;
    QString     SendTextStr;
    QTimer *timer;
    QTimer *timersend;

    QChart *chart;
    //用来更新x坐标实现绘图实时更新
    double x;
    //绘制曲线
    QSplineSeries *lineSeries;
    //XY坐标
    QValueAxis *axisX;
    QValueAxis *axisY;
    QString data;

    QByteArray  SendTextByte;
    void serialSet();
    QSerialPort *serial = new QSerialPort;
    QTimer *timerDrawLine;
private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_3_clicked();

    void dataReceive();

    void on_pushButton_5_clicked();

    void TimeSendReady();

    void SendDataHex();
    //图像
    void Chart_Init();
    void drawsignal();
    void DrawLine();
//    void zoom(QMouseEvent * event);
    void on_pushButton_6_clicked();

private:
    Ui::MainWindow *ui;

};

#endif // MAINWINDOW_H
